package com.gu.mapper;

import com.gu.entity.NoticeDO;

import java.util.Date;
import java.util.List;
import org.apache.ibatis.annotations.Param;

/**
 * 由于需要对分页支持,请直接使用对应的DAO类
 * The Table gu_notice.
 * 通知公告表
 */
public interface NoticeMapper{

    /**
     * desc:插入表:gu_notice.<br/>
     * descSql =  SELECT LAST_INSERT_ID() <![CDATA[ INSERT INTO gu_notice( ID ,TITLE ,CONTENT ,CONTENT_PICTURE_PATH ,CREATE_TIME ,UPDATE_TIME )VALUES( null , #{title,jdbcType=VARCHAR} , #{content,jdbcType=VARCHAR} , #{contentPicturePath,jdbcType=VARCHAR} , #{createTime,jdbcType=DATE} , #{updateTime,jdbcType=DATE} ) ]]>
     * @param entity entity
     * @return Integer
     */
    int insert(NoticeDO entity);
    /**
     * desc:批量插入表:gu_notice.<br/>
     * descSql =  INSERT INTO gu_notice( ID ,TITLE ,CONTENT ,CONTENT_PICTURE_PATH ,CREATE_TIME ,UPDATE_TIME )VALUES ( null , #{item.title,jdbcType=VARCHAR} , #{item.content,jdbcType=VARCHAR} , #{item.contentPicturePath,jdbcType=VARCHAR} , #{item.createTime,jdbcType=DATE} , #{item.updateTime,jdbcType=DATE} ) 
     * @param list list
     * @return Integer
     */
    Integer insertBatch(List<NoticeDO> list);
    /**
     * desc:根据主键删除数据:gu_notice.<br/>
     * descSql =  <![CDATA[ DELETE FROM gu_notice WHERE ID = #{id,jdbcType=INTEGER} ]]>
     * @param id id
     * @return Integer
     */
    Integer deleteById(Integer id);

    /**
     * 批量删除
     * @param ids
     * @return
     */
    Integer deleteByIds(@Param("ids") Integer[] ids);

    /**
     * desc:根据主键获取数据:gu_notice.<br/>
     * descSql =  SELECT * FROM gu_notice WHERE <![CDATA[ ID = #{id,jdbcType=INTEGER} ]]>
     * @param id id
     * @return NoticeDO
     */
    NoticeDO getById(Integer id);

    List<NoticeDO> getNoticeBySearchParam(@Param("searchParam") String searchParam,@Param("searchDate") String searchDate);

//    List<NoticeDO> getNoticeBySearchDate(Date searchDate);
}
